<layout name='Layout/layout_main' />
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.js"></script>
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.setting.js"></script>
<script type="text/javascript">
	function approve() {
		sendForm("form_confirm", "{:U('approve')}", "{:U('read?id='.$vo['id'])}");
	}

	function reject() {
		sendForm("form_confirm", "{:U('reject')}", "{:U('read?id='.$vo['id'])}");
	}

	function save(step) {
		$("#confirm").val("");
		$("#confirm_wrap  span").each(function() {
			$("#confirm").val($("#confirm").val() + $(this).attr("emp_no") + '|');
		})

		$("#consult").val("");
		$("#consult_wrap  span").each(function() {
			$("#consult").val($("#consult").val() + $(this).attr("emp_no") + '|');
		})

		$("#refer").val("");
		$("#refer_wrap  span").each(function() {
			$("#refer").val($("#refer").val() + $(this).attr("emp_no") + '|');
		})
		if ($("#confirm").val().length < 2) {
			alert('请选择审批流程');
			return
		}
		$("#step").val(step);
		editor.sync();
		sendForm("form_data", "{:U('save')}");
	}

	function select_confirm() {
		winopen("{:U('popup/confirm')}",730, 750);
	};

	$(document).ready(function() {
		$("#confirm span").live("dblclick", function() {
			$("#confirm span").last().find("b").remove();
		});
		$("#consult span").live("dblclick", function() {
			$("#consult span").last().find("b").remove();
		});
		show_content();
	}); 
</script>
<div class="title panel panel-default">
	<div class="panel-body">
		<h3 class="col-md-12">{$flow_type.name}:{$vo.name}</h3>
	</div>
</div>

<div class="operate panel panel-default">
	<div class="panel-body">
		<div class="pull-left">
			<a onclick="go_return_url();" class="btn btn-default">返回</a>
			<a href="#flow_status"  class="btn btn-default">裁决情况</a>
			<notempty name="confirm">
				<a href="#confirm"  class="btn btn-default">办理意见</a>
			</notempty>
		</div>
	</div>
</div>
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  class="well form-horizontal">
	<input type="hidden" id="ajax" name="ajax" value="0">
	<input type="hidden" id="type" name="type" value="{$flow_type.id}">
	<input type="hidden" id="opmode" name="opmode" value="add">
	<input type="hidden" id="confirm" name="confirm" value="">
	<input type="hidden" id="consult" name="consult" value="">
	<input type="hidden" id="refer" name="refer" value="">
	<input type="hidden" id="step" name="step" value="">

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" >文件编号：</label>
		<div class="col-md-8">
			<p class="form-control-static">{$vo.doc_no}</p>
		</div>
	</div>

	<div class="form-group col-md-6">
		<label class="col-md-4 control-label" >日期：</label>
		<div class="col-md-8">
			<p class="form-control-static">{$vo.create_time|toDate='Y-m-d'}</p>
		</div>
	</div>

	<div class="form-group  col-md-6">
		<label class="col-md-4 control-label" >编写人：</label>
		<div class="col-md-8">
			<p class="form-control-static">{$vo.user_name}</p>
		</div>
	</div>

	<div class="form-group  col-md-6">
		<label class="col-md-4 control-label" >部门：</label>
		<div class="col-md-8">
			<p class="form-control-static">{$vo.dept_name}</p>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label" >裁决：</label>
		<div class="col-md-10">
			<p id="confirm_wrap" class="form-control-static address_list">{$vo.confirm_name}</p>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label" >协商：</label>
		<div class="col-md-10">
			<p id="consult_wrap" class="form-control-static address_list">{$vo.consult_name}</p>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label" >抄送：</label>
		<div class="col-md-10">
			<p id="refer_wrap" class="form-control-static address_list">{$vo.consult_name}</p>
		</div>
	</div>

	<div class="form-group">
		<div class="col-md-12">
			<div id="content_wrap">
				<iframe id="content_iframe"></iframe>
			</div>
			<textarea id="content_1" name="content" style="width:100%;height:300px;" class="display-none">{$vo.content}</textarea>
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label" >附件：</label>
		<div class="col-md-10">
			<p id="refer_wrap" class="form-control-static address_list">
				<include file="Layout:file_list" />
			</p>
		</div>
	</div>
</form>

<div class="title panel panel-default">
	<div class="panel-body">
		<h3 class="col-md-12">
			<a name="flow_status"></a>
			裁决情况
		</h3>
	</div>
</div>

<div class="ul-table">
	<ul>
		<li class="thead">
			<span style="width:90px;">类型</span>
			<span style="width:90px;">裁决人</span>
			<span style="width:90px;">日期</span>
			<span style="width:90px;">结果</span>
			<span class="auto">意见</span>
		</li>
		<volist name="flow_log" id="item">
			<li class="tbody">
				<span style="width:90px;" class="text-center">{$item.step|show_step_type}</span>
				<span style="width:90px;" class="text-center">{$item.user_name}</span>
				<span style="width:90px;" class="text-center">{$item.create_time|toDate='Y-m-d'}</span>
				<span style="width:90px;" class="text-center">{$item.result|show_result}</span>
				<span class="auto">
					<div style="overflow:hidden">{$item.comment}</div>
				</span>
			</li>
		</volist>
	</ul>
</div>
<notempty name="confirm">
	<div class="title panel panel-default">
		<div class="panel-body">
			<h3 class="col-md-12">
				<a name="confirm"></a>
				办理意见
			</h3>
		</div>
	</div>

	<form method="post" action="" name="form_confirm" id="form_confirm">
		<input type="hidden" name="id" value="{$confirm.id}">
		<input type="hidden" name="flow_id" value="{$vo.id}">
		<input type="hidden" name="step" value="{$confirm.step}">
		<div class="operate panel panel-default">
			<div class="panel-heading clearfix">
				<div class="pull-left">
					<a onclick="go_return_url();" class="btn btn-default">返回</a>
				</div>
				<div class="pull-right">
					<a onclick="approve();" class="btn btn-default">同意</a>
					<a onclick="reject();" class="btn btn-default">驳回</a>
				</div>
			</div>
			<div class="form-group panel-body">
				<label class="col-md-2 control-label" >办理意见：</label>
				<div class="col-md-10">
					<textarea name="comment" class="col-md-12" style="height:120px"></textarea>
				</div>
			</form>
		</notempty>